﻿using System;
using System.ComponentModel.Composition;
using WPFSchematics.Definition.Shapes;
using WPFSchematics.Graphics.Views;

namespace OPSYS_Schematic.ShapeFoundation
{
    /*******************************************************************
     * * 文件名称：IShapeOperation.cs
     * * 功   能：表示一个图形操作，比如选择、平移和缩放
     * * 作   者：yuananyun
     * * 创建日期：2012年3月21日
     * * 修改日期：
     * * 修改人：
     * *******************************************************************/

    public interface IShapeOperation
    {
        /// <summary>
        /// 图形操作所对应的操作函数
        /// </summary>
        Action<IShapeView, object> OperateFunction { get; }
    }

    /// <summary>
    /// 表示ShapOperation的元数据
    /// </summary>
    public interface IShapeOperationMetadata
    {
        //string OperateType { get; set; }
    }

    [MetadataAttribute]
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
    public class ShapeOperationAttribute : ExportAttribute, IShapeOperationMetadata
    {
        public ShapeOperationAttribute()
            : base(typeof(IShapeOperation))
        {
        }

        public ShapeOperationAttribute(Type contractType)
            : base(contractType)
        {
        }

        public ShapeOperationAttribute(string contractName)
            : base(contractName, typeof(IShapeOperation))
        {
        }
    }
}